<!DOCTYPE html>
<html>

<body>

    <p>Click the button to see if the browser is online.</p>

    <button onclick="myFunction()"   style="  font-size: 55px;">   check   </button>
    <h1>检测是否链接到网络</h1>
    <h1>检测网络是否正常</h1>
    <h1 id="demo"></h1>

    <script>
        function myFunction() {
            var x = "Is the browser online?   " + navigator.onLine;
            document.getElementById("demo").innerHTML = x;
        }
    </script>



    



<xmp style="font-size: 22px; font-weight: bolder;  margin-bottom: 66px;  color: black;">


    function myFunction() {
        var x = "Is the browser online? " + navigator.onLine;
        document.getElementById("demo").innerHTML = x;
    }
</xmp>



</body>

</html>